package com.kaifamiao.demo.d0801.factory;


// 工厂类, 简单工厂模式
public class HumanFactory {


    public Human createHuman(int type){
        if (type == 0){
            return new BlackHuman();
        } else if (type == 1){
            return new WhiteHuman();
        } else {
            return new Chinese();
        }
    }

}
